<template>
    <div>
        <el-row style="font-size:8px;text-align:left;margin-top:-22px">欢迎大家来到讨论区！本讨论区供各位同学就课程问题进行交流学习。请同学们认真阅读下面的【讨论区使用规则】，然后再进行相关发表，谢谢！</el-row>
            <el-row>
            <el-button type="primary" style="float: left;margin-top:20px" @click="edit()">发起主题</el-button>    
            </el-row>    
            <el-row style="text-align:left;margin-top:30px">
                <span style="font-size:12px;font-weight:600">子板块</span>
                 <el-divider content-position="left"></el-divider>  
                
                <div style="float: left;">
                <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
                </div>
                <div>
                <el-link :underline="false" style="font-size:12px" @click="change(type.type1)">{{this.type.type1}}</el-link><br>
                <span style="font-size:8px;color:rgb(179, 171, 171)">发表关于作业、测试、课件内容希望能够得到老师回答的疑问。</span>
                <el-divider content-position="left"></el-divider>  
                </div>

                <!---->
                <div style="float: left;">
                <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
                </div>
                <div>
                <el-link :underline="false" style="font-size:12px" @click="change(type.type2)">{{this.type.type2}}</el-link><br>
                <span style="font-size:8px;color:rgb(179, 171, 171)">这里呈现的是在课件中作为教学内容的讨论</span>
                <el-divider content-position="left"></el-divider>  
                </div>

                <div style="float: left;">
                <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
                </div>
                <div>
                <el-link :underline="false" style="font-size:12px" @click="change(type.type3)">{{this.type.type3}}</el-link><br>
                <span style="font-size:8px;color:rgb(179, 171, 171)">发表任何想与大家分享的经验及想法！关于本课程、学习、工作、生活等一般性话题</span>
                <el-divider content-position="left"></el-divider>  
                </div>
            </el-row>
     <Edit_forum :visible='visible' :title="title" :defaultFormData='defaultFormData' 
  v-if='visible' @close = 'close'/>
    </div>
    
</template>

<script>

import Edit_forum from '../../../edit/edit_forum'
import {setCookie} from '@/libs/cookie'
import {getCookie} from '@/libs/cookie'

export default {
    name:'discuss_mune',
      components:{Edit_forum},
     data(){
        return{
            visible: false,
            title:'',
            defaultFormDate:{},
            type:{
                type1:'老师答疑区',
                type2:'课堂交流区',
                type3:'综合讨论区'
            },
            select: {
                type:'',
                title:'',
                key:'1',
                pageNum:1
            },
        }
    },
    methods:{
        change(t){
            this.select.type = t;
            setCookie("forum", JSON.stringify(this.select), {
                         expires: 7
                     })
            let forum = JSON.parse(getCookie("forum") || '{}');
                        console.log(forum)
           this.$router.push("/discuss/content");
        },
        edit(){
        //console.log(row)
        this.visible = true
        this.title = '发帖子'
        this.defaultFormData = {}
      },
       close(val){
        this.visible = false
        this.visible_room = false
     }
    }
}
</script>